import { ResPage } from "@/api/interface/index";
import { Warning } from "@/api/interface/warning24Hours";
import { ALARM } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 告警管理模块
 */
// 获取告警列表
export const getWarningList = (params?: object) => {
  return http.get<ResPage<Warning.ResReqWarningList>>(ALARM + `/alarms/`, params); // 正常 post json 请求  ==>  application/json
};

// 获取工单状态
export const getWorkStatus = (params?: object) => {
  return http.get<Warning.ticketStatus[]>(ALARM + `/overview/ticket_status/`, params); // 正常 post json 请求  ==>  application/json
};

// 获取告警分布
export const getDistribution = (params?: object) => {
  return http.get<Warning.distribution[]>(ALARM + `/overview/distribution/`, params); // 正常 post json 请求  ==>  application/json
};

// 获取告警总览
export const getOverview = (params?: object) => {
  return http.get<Warning.overview[]>(ALARM + `/overview/alarms/`, params); // 正常 post json 请求  ==>  application/json
};

// 获取重要程度
export const getImportance = (params?: object) => {
  return http.get<Warning.importance[]>(ALARM + `/overview/importance_status/`, params); // 正常 post json 请求  ==>  application/json
};

// 统计工单数量
export const getAlarmStatic = (params?: object) => {
  return http.get<Warning.importance[]>(ALARM + `/alarms/alarm_static/`, params);
};
